using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Metadata.Builders;
using Services.Activity.Domain.Entities;

namespace Services.Activity.Infrastructure.Configs;
public class ActivityReviewsConfig : IEntityTypeConfiguration<ActivityReviews>
{
    public void Configure(EntityTypeBuilder<ActivityReviews> builder)
    {
        builder.ToTable("T_ActivityReviews");
        builder.HasKey(x => x.ReviewId).IsClustered(true);
        builder.Property(x => x.ReviewId).UseHiLo();
        builder.Property(x => x.ActivityId).IsRequired();
        builder.Property(x => x.PhotoBase64).IsRequired(false);
        builder.HasQueryFilter(x => x.IsDeleted == false);
    }
}